/*
 Navicat Premium Data Transfer

 Source Server         : MySQL
 Source Server Type    : MySQL
 Source Server Version : 80022
 Source Host           : localhost:3306
 Source Schema         : jwmp

 Target Server Type    : MySQL
 Target Server Version : 80022
 File Encoding         : 65001

 Date: 06/02/2022 00:40:30
*/

SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;

-- ----------------------------
-- Table structure for t_department
-- ----------------------------
DROP TABLE IF EXISTS `t_department`;
CREATE TABLE `t_department` (
  `id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键',
  `name` varchar(25) DEFAULT NULL COMMENT '部门名称',
  `status` bit(1) DEFAULT b'1' COMMENT '部门状态 true ：可用，false取消',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- ----------------------------
-- Table structure for t_emp_role
-- ----------------------------
DROP TABLE IF EXISTS `t_emp_role`;
CREATE TABLE `t_emp_role` (
  `emp_id` bigint NOT NULL COMMENT '员工id',
  `role_id` bigint NOT NULL COMMENT '角色id'
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- ----------------------------
-- Records of t_emp_role
-- ----------------------------
BEGIN;
INSERT INTO `t_emp_role` VALUES (2, 1);
COMMIT;

-- ----------------------------
-- Table structure for t_employee
-- ----------------------------
DROP TABLE IF EXISTS `t_employee`;
CREATE TABLE `t_employee` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `username` varchar(25) DEFAULT NULL COMMENT '账号',
  `password` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '密码',
  `name` varchar(25) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '姓名',
  `email` varchar(25) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '邮箱',
  `age` int DEFAULT NULL COMMENT '年龄',
  `hiredate` date DEFAULT NULL COMMENT '入职时间',
  `admin` bit(1) DEFAULT b'0' COMMENT '是否是管理员：1 是管理员，0:普通用户',
  `status` bit(1) DEFAULT b'1' COMMENT '员工状态：1:启用状态，0：销毁状态',
  `dept_id` bigint DEFAULT NULL COMMENT '部门编号',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;

-- ----------------------------
-- Records of t_employee
-- ----------------------------
BEGIN;
INSERT INTO `t_employee` VALUES (1, 'root', '9aef44e056a783bfea735c6509f44bc1', '超级管理员', NULL, NULL, NULL, b'1', b'1', NULL);
INSERT INTO `t_employee` VALUES (2, 'test1', 'd89f4a1a7a5fbd8ea2f8b30729ce35f7', '系统管理员1', '密码123456', NULL, NULL, b'0', b'1', NULL);
COMMIT;

-- ----------------------------
-- Table structure for t_module
-- ----------------------------
DROP TABLE IF EXISTS `t_module`;
CREATE TABLE `t_module` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `name` varchar(100) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8;

-- ----------------------------
-- Records of t_module
-- ----------------------------
BEGIN;
INSERT INTO `t_module` VALUES (1, '部门管理');
INSERT INTO `t_module` VALUES (2, '员工管理');
INSERT INTO `t_module` VALUES (3, '权限管理');
INSERT INTO `t_module` VALUES (4, '角色管理');
COMMIT;

-- ----------------------------
-- Table structure for t_permission
-- ----------------------------
DROP TABLE IF EXISTS `t_permission`;
CREATE TABLE `t_permission` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `name` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '权限文字描述',
  `expression` varchar(100) DEFAULT NULL COMMENT '权限名称或地址',
  `module_id` bigint DEFAULT NULL COMMENT '权限所属模块名称',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=41 DEFAULT CHARSET=utf8;

-- ----------------------------
-- Records of t_permission
-- ----------------------------
BEGIN;
INSERT INTO `t_permission` VALUES (1, '部门编辑页面', '/department/edit', 1);
INSERT INTO `t_permission` VALUES (2, '启用和注销', '/department/updateStatus', 1);
INSERT INTO `t_permission` VALUES (3, '部门员工管理页面', '/department/editEmployee', 1);
INSERT INTO `t_permission` VALUES (4, '部门绑定员工', '/department/bindEmployee', 1);
INSERT INTO `t_permission` VALUES (5, '部门保存或修改', '/department/saveOrUpdate', 1);
INSERT INTO `t_permission` VALUES (6, '部门列表', '/department/list', 1);
INSERT INTO `t_permission` VALUES (7, '部门编辑页面', '/department/edit', 1);
INSERT INTO `t_permission` VALUES (8, '启用和注销', '/department/updateStatus', 1);
INSERT INTO `t_permission` VALUES (9, '部门员工管理页面', '/department/editEmployee', 1);
INSERT INTO `t_permission` VALUES (10, '部门绑定员工', '/department/bindEmployee', 1);
INSERT INTO `t_permission` VALUES (11, '部门保存或修改', '/department/saveOrUpdate', 1);
INSERT INTO `t_permission` VALUES (12, '部门列表', '/department/list', 1);
INSERT INTO `t_permission` VALUES (13, '绑定角色', '/employee/bindRole', 2);
INSERT INTO `t_permission` VALUES (14, '员工编辑页面', '/employee/edit', 2);
INSERT INTO `t_permission` VALUES (15, '绑定角色页面', '/employee/bindRoleEdit', 2);
INSERT INTO `t_permission` VALUES (16, '启用和注销员工', '/employee/updateStatus', 2);
INSERT INTO `t_permission` VALUES (17, '员工保存或修改', '/employee/saveOrUpdate', 2);
INSERT INTO `t_permission` VALUES (18, '员工列表', '/employee/list', 2);
INSERT INTO `t_permission` VALUES (19, '绑定角色', '/employee/bindRole', 2);
INSERT INTO `t_permission` VALUES (20, '员工编辑页面', '/employee/edit', 2);
INSERT INTO `t_permission` VALUES (21, '绑定角色页面', '/employee/bindRoleEdit', 2);
INSERT INTO `t_permission` VALUES (22, '启用和注销员工', '/employee/updateStatus', 2);
INSERT INTO `t_permission` VALUES (23, '员工保存或修改', '/employee/saveOrUpdate', 2);
INSERT INTO `t_permission` VALUES (24, '员工列表', '/employee/list', 2);
INSERT INTO `t_permission` VALUES (25, '权限列表', '/permission/list', 3);
INSERT INTO `t_permission` VALUES (26, '重新加载权限', '/permission/reload', 3);
INSERT INTO `t_permission` VALUES (27, '权限列表', '/permission/list', 3);
INSERT INTO `t_permission` VALUES (28, '重新加载权限', '/permission/reload', 3);
INSERT INTO `t_permission` VALUES (29, '角色编辑', '/role/edit', 4);
INSERT INTO `t_permission` VALUES (30, '角色修改或者保存', '/role/saveOrUpdate', 4);
INSERT INTO `t_permission` VALUES (31, '角色删除', '/role/delete', 4);
INSERT INTO `t_permission` VALUES (32, '角色列表', '/role/list', 4);
INSERT INTO `t_permission` VALUES (33, '角色授权页', '/permission/permissionEdit', 4);
INSERT INTO `t_permission` VALUES (34, '角色授权', '/permission/authorizeForRole', 4);
INSERT INTO `t_permission` VALUES (35, '角色编辑', '/role/edit', 4);
INSERT INTO `t_permission` VALUES (36, '角色修改或者保存', '/role/saveOrUpdate', 4);
INSERT INTO `t_permission` VALUES (37, '角色删除', '/role/delete', 4);
INSERT INTO `t_permission` VALUES (38, '角色列表', '/role/list', 4);
INSERT INTO `t_permission` VALUES (39, '角色授权页', '/permission/permissionEdit', 4);
INSERT INTO `t_permission` VALUES (40, '角色授权', '/permission/authorizeForRole', 4);
COMMIT;

-- ----------------------------
-- Table structure for t_role
-- ----------------------------
DROP TABLE IF EXISTS `t_role`;
CREATE TABLE `t_role` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `name` varchar(25) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL,
  `introduce` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;

-- ----------------------------
-- Records of t_role
-- ----------------------------
BEGIN;
INSERT INTO `t_role` VALUES (1, '系统管理员', '能操作系统管理下所有功能');
COMMIT;

-- ----------------------------
-- Table structure for t_role_permission
-- ----------------------------
DROP TABLE IF EXISTS `t_role_permission`;
CREATE TABLE `t_role_permission` (
  `role_id` bigint NOT NULL,
  `permission_id` bigint NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- ----------------------------
-- Records of t_role_permission
-- ----------------------------
BEGIN;
INSERT INTO `t_role_permission` VALUES (1, 1);
INSERT INTO `t_role_permission` VALUES (1, 2);
INSERT INTO `t_role_permission` VALUES (1, 3);
INSERT INTO `t_role_permission` VALUES (1, 4);
INSERT INTO `t_role_permission` VALUES (1, 5);
INSERT INTO `t_role_permission` VALUES (1, 6);
INSERT INTO `t_role_permission` VALUES (1, 7);
INSERT INTO `t_role_permission` VALUES (1, 8);
INSERT INTO `t_role_permission` VALUES (1, 9);
INSERT INTO `t_role_permission` VALUES (1, 10);
INSERT INTO `t_role_permission` VALUES (1, 11);
INSERT INTO `t_role_permission` VALUES (1, 12);
INSERT INTO `t_role_permission` VALUES (1, 13);
INSERT INTO `t_role_permission` VALUES (1, 14);
INSERT INTO `t_role_permission` VALUES (1, 15);
INSERT INTO `t_role_permission` VALUES (1, 16);
INSERT INTO `t_role_permission` VALUES (1, 17);
INSERT INTO `t_role_permission` VALUES (1, 18);
INSERT INTO `t_role_permission` VALUES (1, 19);
INSERT INTO `t_role_permission` VALUES (1, 20);
INSERT INTO `t_role_permission` VALUES (1, 21);
INSERT INTO `t_role_permission` VALUES (1, 22);
INSERT INTO `t_role_permission` VALUES (1, 23);
INSERT INTO `t_role_permission` VALUES (1, 24);
INSERT INTO `t_role_permission` VALUES (1, 25);
INSERT INTO `t_role_permission` VALUES (1, 26);
INSERT INTO `t_role_permission` VALUES (1, 27);
INSERT INTO `t_role_permission` VALUES (1, 28);
INSERT INTO `t_role_permission` VALUES (1, 29);
INSERT INTO `t_role_permission` VALUES (1, 30);
INSERT INTO `t_role_permission` VALUES (1, 31);
INSERT INTO `t_role_permission` VALUES (1, 32);
INSERT INTO `t_role_permission` VALUES (1, 33);
INSERT INTO `t_role_permission` VALUES (1, 34);
INSERT INTO `t_role_permission` VALUES (1, 35);
INSERT INTO `t_role_permission` VALUES (1, 36);
INSERT INTO `t_role_permission` VALUES (1, 37);
INSERT INTO `t_role_permission` VALUES (1, 38);
INSERT INTO `t_role_permission` VALUES (1, 39);
INSERT INTO `t_role_permission` VALUES (1, 40);
COMMIT;

SET FOREIGN_KEY_CHECKS = 1;
